package com.zdb.controller;

import com.zdb.common.Result;
import com.zdb.service.FileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/file")
public class FileController {
    @Autowired
    private FileService fileService;
    @PostMapping("/upload")
    public Result uploadFile(MultipartFile  file){
        String url= fileService.uploadFile(file);
        return Result.sucess("上传成功",url);
    }
}
